home *** CD-ROM | disk | FTP | other *** search
/ Die Speccy' 97 / Die Speccy' 97.iso / amiga_system / the_aminet / comm / cnet / cnet_who.lha / Convert_21_251 < prev    next >
Text File  |  1995-10-15  |  6KB  |  115 lines

  1. /**************************************************************************\
  2.           $VER: CNet WHO Convert, v2.51 (15-Oct-95) by Dotoran!
  3. \**************************************************************************/
  4. options results ; signal on SYNTAX ; signal on ERROR ; signal on IOERR
  5. tr=transmit ; se=sendstring ; gc=getchar ; gu=getuser ; gs=getscratch
  6. a='rexxsupport.library';if ~show('l',a) then if ~addlib(a,0,-30) then exit
  7.  
  8. CONVERT:
  9.   tr "f1Convert CNet WHO, v2.1(c/d) into CNet WHO, v2.51n1@4"
  10.  
  11.   if ~exists("pfiles:who/glimpses") then do
  12.     tr "The conversion process has already been completed!";exit;end
  13.  
  14.   se "This file only makes changes needed for the data files to upgrade to "
  15.   se "v2.51 CNet WHO, however you should STILL READ the Convert_README! "
  16.   se "file for more steps in the conversion process. Press any key to begin "
  17.   se "this portion of the conversion process...<Key>g1Thanks!n1"
  18.  
  19.   call open(f1,"pfiles:who/config.data","r")
  20.     do i=1 until eof(f1) ; l.i=readln(f1) ; end i ; tot=i-1
  21.   call close(f1)
  22.  
  23.   if tot<12 then do
  24.     se "Uh-Oh, there are LESS THAN 12 lines in your Config.data file! This "
  25.     se "could mean that the file is corrupt, or that you may be using a "
  26.     se "version of CNet Who PREVIOUS to v2.1. You will need to completely "
  27.     se "purge your system of whatever version you are presently running, "
  28.     se "then follow the procedures outlined in the WHO_README! file for "
  29.     tr "installing this mod for the first time.";exit;end
  30.  
  31.   if tot=12 then do ; call BBSTEXT
  32.     se "Running v2.1 CNet Who...updating Config.data file..."
  33.     l.0=l107''l903''l1066''fake''l5''l4'x'
  34.     parse var l.4 v1''v2''v3''v4''v5''v6''v7''v8''v9''j
  35.     l.4=v1''v2''v3''v4''v5''v6''v7''v8''v9'10x'
  36.     parse var l.8 v1''v2''v3''v4''v5''v6''v7''v8''v9''j
  37.     l.8=v1''v2''v3''v4''v5''v6''v7''v8''v9'10x'
  38.     parse var l.12 v1''v2''v3''v4''v5''v6''v7''v8''v9''j
  39.     l.12=v1''v2''v3''v4''v5''v6''v7''v8''v9'10x'
  40.     tr "done.";end
  41.  
  42.   if tot=13 then do ; call BBSTEXT
  43.     se "Running v2.1c or v2.1d CNet Who...updating Config.data file..."
  44.     l.1=l107''l903''l1066''fake''l5''l4'x'
  45.     parse var l.5 v1''v2''v3''v4''v5''v6''v7''v8''v9''j
  46.     l.5=v1''v2''v3''v4''v5''v6''v7''v8''v9'10x'
  47.     parse var l.9 v1''v2''v3''v4''v5''v6''v7''v8''v9''j
  48.     l.9=v1''v2''v3''v4''v5''v6''v7''v8''v9'10x'
  49.     parse var l.13 v1''v2''v3''v4''v5''v6''v7''v8''v9''j
  50.     l.13=v1''v2''v3''v4''v5''v6''v7''v8''v9'10x'
  51.     tr "done.";end
  52.  
  53.   se "n1Saving updated Config.data file..."
  54.   call open(f1,"pfiles:who/Config.data","w")
  55.     lo=1 ; hi=13 ; if tot=12 then do ; lo=0 ; hi=12 ; end
  56.     do i=lo to hi ; call writeln(f1,l.i) ; end i
  57.   call close(f1) ; tr "done.n1"
  58.  
  59.   tr "Assembling UUCP Directories from Serial ID Numbers:n1"
  60.   gu 2400088 ; acts=result ; mdir.="" ; do i=1 to acts
  61.     loadscratch i ; st=result ; savescratch (-i) ; getscratch 1 ; han=result
  62.     se right(i,4,"0")right(han,22,".")":"
  63.     if st<1|han="!" then do ; tr " Deleted Account!";iterate i;end
  64.     getscratch 41 ; sid=result ; getscratch 39 ; uucp=result
  65.     mdir.sid="mail:users/"uucp"/" ; tr right(sid,4)" = "mdir.sid
  66.   end i
  67. GLIMPSES:
  68.   tr "n1Moving existing Glimpse files into appropriate UUCP Directories:n1"
  69.   a=showdir("pfiles:who/glimpses/",," ")
  70.   if a="" then do ; tr "No Glimpse files found!" ; signal BANNERS ; end
  71.   do i=1 to words(a) ; z=word(a,i) ; zz=mdir.z ; if zz="" then do
  72.     tr "Serial ID Number `"z"' no longer in use; skipping." ; iterate i ; end
  73.     tr "Copying `"z"' as `"zz"_Glimpse' file."
  74.     address command "copy pfiles:who/glimpses/"z" "zz"_Glimpse"
  75.   end i
  76. BANNERS:
  77.   tr "n1Moving existing Banners files into appropriate UUCP Directories:n1"
  78.   a=showdir("pfiles:who/banners/",," ")
  79.   if a="" then do ; tr "No Banners files found!" ; signal HISTORIES ; end
  80.   do i=1 to words(a) ; z=word(a,i) ; zz=mdir.z ; if zz="" then do
  81.     tr "Serial ID Number `"z"' no longer in use; skipping." ; iterate i ; end
  82.     tr "Copying `"z"' as `"zz"_Banners' file."
  83.     address command "copy pfiles:who/banners/"z" "zz"_Banners"
  84.   end i
  85. HISTORIES:
  86.   tr "n1Moving existing History files into appropriate UUCP Directories:n1"
  87.   a=showdir("pfiles:who/histories/",," ")
  88.   if a="" then do ; tr "No History files found!" ; signal DONE ; end
  89.   do i=1 to words(a) ; z=word(a,i) ; zz=mdir.z ; if zz="" then do
  90.     tr "Serial ID Number `"z"' no longer in use; skipping." ; iterate i ; end
  91.     tr "Copying `"z"' as `"zz"_History' file."
  92.     address command "copy pfiles:who/histories/"z" "zz"_History"
  93.   end i
  94. DONE:
  95.   se "n1Deleting `Glimpses/', `Banners/', and `Histories/' directories "
  96.   tr "from the `pfiles:who/' directory..."
  97.   address command "delete pfiles:who/glimpses/ all"
  98.   address command "delete pfiles:who/banners/ all"
  99.   address command "delete pfiles:who/histories/ all"
  100.   tr "n1Conversion complete!"
  101.  exit
  102.  
  103. BBSTEXT:
  104.   l4=BBSLINE(1,4);l5=BBSLINE(1,5);l107=BBSLINE(1,107);l903=BBSLINE(1,903)
  105.   l1066=BBSLINE(1,1066);fake=430;return
  106. BBSLINE: procedure;arg ty,li;getuser 1402018+(ty*4)
  107.   ln=import(import(offset(x2c(d2x(result,8)),(li-1)*4),4),1024)
  108.   parse var ln ln'00'x .;return ln
  109.  
  110. SYNTAX:;ERROR:;IOERR:;e1=' Error: 'rc' ('errortext(rc)')'
  111.   e2='  Line: 'left(sigl,4)'File:';gu 1311992;a=result;gu 1311960;b=result;c='"'a||b'"';e2=e2' 'c;tr e1;tr e2;logentry e1;logentry e2
  112.   e=sourceline(sigl);do while e~='';e3='Source: 'left(e,37);tr e3;logentry e3;e=substr(e,38);end;bufferflush;exit
  113. /** Last Edited: 15-Oct-95 ************************************************\
  114. \****************************************** Frontiers BBS (716)/823-9892 **/
  115.